package com.nantian.logic.entity.mainEntity.universityEntity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "university", schema = "springBoot")
public class UniversityEntity {
    private int id;
    private String universityname;
    private Integer proid;
    private Integer cityid;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "universityname")
    public String getUniversityname() {
        return universityname;
    }

    public void setUniversityname(String universityname) {
        this.universityname = universityname;
    }

    @Basic
    @Column(name = "proid")
    public Integer getProid() {
        return proid;
    }

    public void setProid(Integer proid) {
        this.proid = proid;
    }

    @Basic
    @Column(name = "cityid")
    public Integer getCityid() {
        return cityid;
    }

    public void setCityid(Integer cityid) {
        this.cityid = cityid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UniversityEntity that = (UniversityEntity) o;
        return id == that.id &&
                Objects.equals(universityname, that.universityname) &&
                Objects.equals(proid, that.proid) &&
                Objects.equals(cityid, that.cityid);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, universityname, proid, cityid);
    }
}
